Repository navigation
fix: bundle a pinned, filtered airports snapshot and scale airport and port points with zoom (#9) - #23
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
…#9) Fetches airports.csv at ourairports-data commit 64af129, keeps large, medium, and small airports with valid coordinates rounded to 3 decimals, and writes public/data/airports.json (1,967,855 bytes, 623,559 gzip, 48,072 rows) plus airports.meta.json. CI does not run the script. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
Adds decodeAirports and selectMajorAirports, switches useAirports to the bundled columnar JSON, and returns majorAirports computed once per load. App test fetch mocks move to AIRPORTS_DATA_URL with JSON bodies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
…#9) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
…ay legible (#9) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
…path (#9) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
Regenerated with npm run data:airports; public/data/airports.json is byte-identical to the committed file, only airports.meta.json changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Airports no longer come from a 12.7 MB unpinned CSV on raw.githubusercontent.com parsed on the main thread. A local build script (
npm run data:airports,scripts/build-airports.mjs) fetches OurAirportsairports.csvpinned to commit64af12951161ed52bc733eb4101224643c48850a, drops closed airports, heliports, seaplane bases, balloonports, unknown types, and rows without valid coordinates, and writes a compact columnarpublic/data/airports.json(1,967,855 bytes, 623,559 bytes gzip -9) pluspublic/data/airports.meta.json(source URL, commit, fetch time in UTC, per-type counts, license: public domain). Both files are committed; the app fetches/data/airports.jsonsame-origin, likeports.geojson. CI does not run the script.JSON.parseplus 2 to 5 ms for decode in the browser, so it never forms a long task (see evidence).Plan
docs/plans/2026-11-07-issue-9-airports-preprocessed-data.md, first committed at 0e57bfe, last revised at d592ad9. Revisions during the work, each in the commit that departed: App test mocks moved into the hook step so every commit stays green; counts also record each upstream input type; the long task analysis and the decision not to add the Worker; review fixes (ports radius, strict parser and empty-output guard, realpath main guard, full UTCfetchedAt).Test evidence
Gate (worktree, final tree before push), all exit 0:
npm ci: found 0 vulnerabilitiesnpm run lint: cleannpm test: Test Files 49 passed (49), Tests 437 passed (437)npm run build: built (the existing chunk size warning over 500 kB predates this change)npm audit --omit=dev --audit-level=high: found 0 vulnerabilitiesLive drive (production preview, headless Chrome 157,
--enable-unsafe-webgpu --use-webgpu-adapter=swiftshader, 1440 x 900), by the implementer and again by an independent verifier:/data/airports.jsonsame-origin, 200, 626,850 bytes transferred (gzip).Airports: 5,282 FEATURES,Sea Ports: 1,081 FEATURES,Heatmap: READY, headerSYS NOMINAL.JSON.parseof the real file 3.1 to 4.1 ms, decode 1.6 to 4.6 ms. Long tasks over 50 ms do occur during startup (longest 122 to 181 ms across runs), but none is parsing: with the airports response held 5 s they start only afterres.json()resolves; a CPU profile puts 1.7 ms of them in decode and the rest in native WebGL work in deck.gl's first draw; and with the Airports and Heatmap layers unticked (data still fetched, parsed, decoded, heatmap computed) no long task follows the airports response. With airports blocked entirely, MapLibre and deck.gl init still produce 65 to 182 ms tasks./data/airports.jsonshowedLOAD FAILED,RETRY, heatmapNO AIRPORT DATA,SYS DEGRADED: AIRPORTS FAILED; RETRY recovered to 5,282 features, heatmap READY, SYS NOMINAL. Same for ports. A malformed body showsLOAD FAILEDwith "Airport data is malformed" and recovers on retry.Review findings
First round: three Claude finders (bugs and compliance; security and data safety; outside the diff) and two Fable finders (bugs and compliance; edge cases), then one confirmation finder. Fixed, each with a test committed red first:
checkCountsguard before any write, warning on unknown types.inputByTypein a plain object lost a__proto__type (Claude finder note). Fixed with a Map.fetchedAtwas a UTC date without a zone marker, one day ahead of the local run (Fable edge-case finder). Fixed: full ISO timestamp, README says UTC.Delta finder on the fixes: no findings. Verifier: no findings.
Dismissed or left as notes:
docs/superpowers/and older plans still describe the runtime CSV: historical records, not current docs.decodeAirportsdoes not checkversion; the plan did not ask for it./data/airports.jsonbreaks under a non-root Vitebase: same as the existing ports URL, and nobaseis set.Docs reconciled
README.md: airports, ports, and heatmap bullets; network access; scripts table (npm run data:airports); CI note; data sources row (pinned commit, fetch time, filters, counts, sizes, public domain); project layout; known limitations.src/config/sources.js:AIRPORTS_DATA_URLreplacesOURAIRPORTS_CSV_URL, comment names the generated file, script, pinned commit, and license.CLAUDE.md: no change needed because it only says data URLs live insrc/config/sources.js, which is still true.Closes #9
🤖 Generated with Claude Code
https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf